import request from '@/utils/request'
import { AxiosResponse } from 'axios'

// 阿里云图片上传凭证
export const getuploadImage = ():Promise<AxiosResponse> => {
  return request({
    method: 'GET',
    url: '/boss/course/upload/aliyunImagUploadAddressAdnAuth.json'
  })
}

// 阿里云视频上传凭证
export const getuploadVideo = (params:any):Promise<AxiosResponse> => {
  return request({
    method: 'GET',
    url: '/boss/course/upload/aliyunVideoUploadAddressAdnAuth.json',
    params
  })
}

// 阿里云转码进度
export const transCodePercent = (lessonId:any):Promise<AxiosResponse> => {
  return request({
    method: 'GET',
    url: '/boss/course/upload/aliyunTransCodePercent.json',
    params: {
      lessonId
    }
  })
}

// 阿里云转码请求
export const transCode = (data:any):Promise<AxiosResponse> => {
  return request({
    method: 'POST',
    url: '/boss/course/upload/aliyunTransCode.json',
    data
  })
}
